package com.mvp.shq.washer.ui.shop.mall;

import com.mvp.shq.washer.entity.result.BaseResult;
import com.mvp.shq.washer.entity.shop.ShopBanner;
import com.mvp.shq.washer.entity.shop.result.ProductResult;
import com.mvp.shq.washer.http.RxSchedulers;
import com.mvp.shq.washer.http.ShopApi;

import java.util.List;

import io.reactivex.Observable;

/**
 * Created by shq1 on 2017/9/29.
 */

public class Model implements MallConstract.Model {
    @Override
    public Observable<BaseResult<ProductResult>> getRecommentProduct() {
        return ShopApi.getInstance().service
                .getRecommentProduct()
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<ProductResult>> getHotProduct() {
        return ShopApi.getInstance().service
                .getHotProduct()
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<List<ShopBanner>>> getBanner() {
        return ShopApi.getInstance().service
                .getBanner()
                .compose(RxSchedulers.io_main());
    }
}
